﻿int size = index;
struct patient * p = patients;
struct patient * pp = (struct patient * ) malloc(sizeof(struct patient) * size);
int s = 0;
for (int i = 0; i < size; i++) {
  if (p[i].temperature > 36) {
    pp[s] = p[i];
    strcpy(pp[s].name, p[i].name);
    strcpy(pp[s].gender, p[i].gender);
    s++;
  }
}
for (int j = 0; j < s; j++) {
  for (int i = 0; i < s - 1; i++) {
    if (pp[i].temperature > pp[i + 1].temperature) {
      struct patient t;
      t = pp[i];
      strcpy(t.name, pp[i].name);
      strcpy(t.gender, pp[i].gender);
      pp[i] = pp[i + 1];
      strcpy(pp[i].name, pp[i + 1].name);
      strcpy(pp[i].gender, pp[i + 1].gender);
      pp[i + 1] = t;
      strcpy(pp[i + 1].name, t.name);
      strcpy(pp[i + 1].gender, t.gender);
    }
  }
}
ss = s;
return pp;
